package cn.melon.mod.library;

import org.json.JSONException;
import org.json.JSONObject;

public class Books extends LibraryBooksInfo{

	public Books(String bookName, String bookID, String publisher, String author, String loanable, String borrowStudent,
			String borrowDate, String DDL, String returnDate) {

		super(bookName, bookID, publisher, author, loanable, borrowStudent, borrowDate, DDL, returnDate);

	}

	public JSONObject toJsonObject(){
		JSONObject jsonObject = new JSONObject();
		
		try {
			jsonObject.put("bookName", this.getBookName());
			jsonObject.put("bookID", this.getBookID());
			jsonObject.put("publisher", this.getPublisher());
			jsonObject.put("author", this.getAuthor());
			jsonObject.put("loanable", this.getLoanable());
			jsonObject.put("borrowDate", this.getBorrowDate());
			jsonObject.put("DDL", this.getDDL());
			jsonObject.put("returnDate", this.getReturnDate());
		} catch (JSONException e) {
			e.printStackTrace();
		}

		return jsonObject;
	}
}
